VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "DAOEstado"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Option Explicit

Private mvarConnection As utilConexion 'local copy

Public Sub setConnection(ByVal vData As utilConexion)
'used when assigning an Object to the property, on the left side of a Set statement.
'Syntax: Set x.Connection = Form1
    Set mvarConnection = vData
End Sub


Public Function getLista(tabla As String) As Collection
Dim sql As String
Dim rst As New Recordset
Dim list As New Collection
Dim record As New bEstado

sql = "SELECT nCodigo, sDescripcion FROM estado where sTabla= '" + tabla + "'"
rst.Open sql, mvarConnection.Connection, adOpenForwardOnly

While Not rst.EOF
    Set record = New bEstado
    If Not IsNull(rst.Fields("nCodigo")) Then record.nCodigo = rst.Fields("nCodigo").value
    If Not IsNull(rst.Fields("sDescripcion")) Then record.sDescripcion = rst.Fields("sDescripcion").value
    rst.MoveNext
    list.Add record
Wend
Set getLista = list
End Function
